﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;

namespace ALE_Server.EC
{
    [Serializable]
    [DataContract]
    public class ECReportGroup
    {
        private string m_GroupName;
        private ECReportGroupCount m_GroupCount;
        private ECReportGroupList m_GroupList = new ECReportGroupList();

        public ECReportGroup()
        {
        }

        public ECReportGroup(string groupName)
        {
            m_GroupName = groupName;
        }

        [DataMember]
        public string GroupName
        {
            get
            {
                return m_GroupName;
            }
            set
            {
                m_GroupName = value;
            }
        }

        [DataMember]
        public ECReportGroupCount GroupCount
        {
            get
            {
                return m_GroupCount;
            }
            set
            {
                m_GroupCount = value;
            }
        }

        [DataMember]
        public ECReportGroupList GroupList
        {
            get
            {
                return m_GroupList;
            }
            set
            {
                m_GroupList = value;
            }
        }

        public void AddMember(ECReportGroupListMember member)
        {
            if (member != null)
            {
                GroupList.AddMember(member);
            }
        }

        public void RemoveMember(ECReportGroupListMember member)
        {
            if (member != null)
            {
                GroupList.RemoveMember(member);
            }
        }
        public override string ToString()
        {
            return XmlSerializeHelper.Serialize(this);
        }
    }
}
